﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WyUnity.Data.DataAccess;
using WyUnity.Data.Query;
using WyUnity.Data.TableMapper;

namespace DAL_13_0.Entities
{
	[Map("t_ICItem")]
	public class ICItem : TableBase<ICItem>
	{
		[Map]
		public int FItemID { get; set; }
		[Map]
		public string FNumber { get; set; }
		[Map]
		public string FName { get;set;}
		[Map]
		public int FUnitID { get; set; }
		[Map]
		public int FUnitGroupID { get; set; }
		[Map("F_102")]
		public int PackageUnitID { get; set; }
		[Map("F_103")]
		public string Barcode { get; set; }

        public static FieldBase pNumber = new Field<ICItem>(p => p.FNumber);
        public static FieldBase pName = new Field<ICItem>(p => p.FNumber);
        public static FieldBase pID = new Field<ICItem>(p => p.FItemID);

        public static ICItem Get(DbSession session, string number, int classid)
        {
            return session.QuerySingle<ICItem>(pNumber == number);
        }
	}

}
